// pages/category/category.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    topic:["推荐","视频","热点","本地","社会","娱乐","科技","汽车","体育","财经","军事","国际","时尚","游戏","美文","历史","听书"],
    currentTab:0,
    productList:[{title: '商品A', price: 236,soldNum:455, type:"数码产品",img: '/images/goods/bag.jpg'},{title:'商品B', price: 88, soldNum:45, type:"潮流", img: '/images/goods/milk.jpg'},{title:'商品C', price: 850, soldNum:1455, type:"食品",img: '/images/goods/watch.jpg'},{title: '商品D', price: 2360, soldNum:4550,  type:"数码产品",img: '/images/goods/notebook.jpg'}]
  },
 //切换水平滚动项
 switch: function (e) {
    var page = this;
    if (this.data.currentTab == e.target.dataset.current) {
      return false;
    } else {
      page.setData({ currentTab: e.target.dataset.current });
    }
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})